home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 1.2 KB | 61 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWGrRef.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWGRREF_H
- #define FWGRREF_H
-
- //========================================================================================
- // class FW_TGrRefPtr
- //========================================================================================
-
- #ifdef _MSC_VER
-
- // Visual C++ has trouble with friends of templates (see below)
-
- template<class T>
- void FW_PrivAcquireGrRep(T rep);
-
- template<class T>
- void FW_PrivReleaseGrRep(T rep);
-
- #endif
-
- template <class T>
- class FW_TGrRefPtr
- {
- public:
- FW_DECLARE_AUTO(FW_TGrRefPtr)
-
- #ifndef _MSC_VER
- friend void FW_PrivAcquireGrRep(T rep);
- friend void FW_PrivReleaseGrRep(T rep);
- #endif
-
- FW_TGrRefPtr(T rep = 0);
- ~FW_TGrRefPtr();
-
- void operator=(const FW_TGrRefPtr<T>& other)
- { SetRep(other.fRep); }
-
- void operator=(T rep)
- { SetRep(rep); }
-
- operator T() const
- { return fRep; }
-
- void SetRep(T rep);
-
- protected:
- T fRep;
-
- FW_TGrRefPtr(const FW_TGrRefPtr<T>& other);
- };
-
- #endif // FWGRREF_H
-